<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<#include "lib/lib.html" />

<title>应用管理</title>
</head>
<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>
		系统管理 <span class="c-gray en">&gt;</span> 应用管理 
		<a class="btn btn-success radius r mr-20" id="refresh" style="line-height: 1.6em; margin-top: 3px" href="javascript:location.replace(location.href);" title="刷新">
		<i class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<div class="pd-20 text-c">
		<div class="text-c">
			<form action="${basePath}/admin/goapplist.do">
				<input type="text" name="appsName" id="appsName" placeholder="应用名称、id" style="width: 250px" class="input-text">
				<button name="" id="" class="btn btn-success" type="submit">
					<i class="Hui-iconfont">&#xe665;</i> 搜索
				</button>
			</form>
		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20">
			<span class="l">
				
				<a class="btn btn-primary radius" onclick="app_add('添加应用','${basePath}/admin/goaddapp.do')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加应用</a></span> <span class="r">
				
			</span>
		</div>
		<div class="mt-20">
			<table class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
						<th width="25"><!-- <input type="checkbox" name="" value=""> --></th>
						<th width="150">应用名称</th>
						<th width="150">应用类型</th>
						<th width="150">应用编码</th>
						<th>应用详情</th>
						<th width="150">创建时间</th>
						<th width="100">操作</th>
					</tr>
				</thead>
				<tbody>
					<#if list.dataList?? && list.dataList?size gt 0>
					<#list list.dataList as dl >
						<tr class="text-c">
							<td><!-- <input type="checkbox" value="${dl.id}" name=""> -->${dl_index+1}</td>
							<td>${dl.appsName!}</td>
							<td>
								<#if dl.appsType ==1>客户端<#elseif dl.appsType ==2>PC端<#else>其他</#if>
							</td>
							<td>${dl.appsCode!}</td>
							<td>${dl.appsDesc!}</td>
							<td>${dl.createTime?string('yyyy-MM-dd')}</td>
							<td class="td-manage">
								<a title="添加菜单" href="javascript:;" onclick="add_menu('添加菜单','${basePath}/function/goaddmenu.do?appId=${dl.id!}','1','800','500')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6bf;</i></a>
								<a title="编辑" href="javascript:;" onclick="app_edit('编辑应用','${basePath}/admin/goaddapp.do?id=${dl.id!}','1','800','500')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a> 
								<a title="删除" href="javascript:;" onclick="app_del(this,${dl.id!})" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
						</tr>
					</#list>
					</#if>
				</tbody>
			</table>
			</br>
			<div class="page_list"></div>
		</div>
	</div>
	<script type="text/javascript">
	
		$(function(){
		 	laypage({
		 	    cont: $('.page_list'), //容器。值支持id名、原生dom对象，jquery对象,
			    pages: ${list.endPage! }, //总页数
		 	    //skip: true, //是否开启跳页
	// 	    	skin: 'molv',
		 	    groups: 10, //连续显示分页数
		 	    first: '首页', //若不显示，设置false即可
		 	    last: '尾页', //若不显示，设置false即可
		 	    curr:${list.curPage!},
		 	   	hash: true, //开启hash
		 	    skin: '#00AA91',
		 	    jump: function(obj,first){ //触发分页后的回调
	// 	 	       $('.view').html('目前正在第'+ obj.curr +'页，一共有：'+ obj.pages +'页');
		 	    	if(!first){
		 	         	 window.location.href="${basePath}/admin/goapplist.do?curPage="+obj.curr +"&pageData="+10;
		 	    	}
		 	    }
		 	});
		 			
		});
		/*系统-应用-添加*/
		function app_add(title, url, w, h) {
			layer_show(title, url, w, h);
		}
		/*系统-应用-编辑*/
		function app_edit(title, url, id, w, h) {
			layer_show(title, url, w, h);
		}
		
		/*添加菜单*/
		function add_menu(title, url, id, w, h) {
			layer_show(title, url, w, h);
		}
		
		/*系统-应用-删除*/
		function app_del(obj, id) {
			layer.confirm('确认要删除吗？', function(index) {
				var data = {};
				data.id = id;
				//后台请求保存数据
				$.axse("${basePath}/admin/delapp.do",  data, function(d){
					if(d.resultCode == 200){
						$(obj).parents("tr").remove();
						layer.msg('已删除!', {
							icon : 1,
							time : 1000
						});
					}else{
						Huimodal_alert("删除失败,请重试!",1500);
					}
				},
				function(d){
					Huimodal_alert("删除失败,请重试!",1500);
				});
			});
		}
	</script>
</body>
</html>